home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Pascal Super Library
/
Pascal Super Library (CW International)(1997).bin
/
LIBRARY
/
RTPC10
/
VGA_D.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-11-20
|
3KB
|
93 lines
{
┌────────┬──────────────────────────────────────────────────────┐
│Name │ VGA_D.PAS │
├────────┼──────────────────────────────────────────────────────┤
│Use │ Example program using VGA.TPU │
├────────┼──────────────────────────────────────────────────────┤
│By │ Rafe Aldridge - (C) Copyright 1993 │
└────────┴──────────────────────────────────────────────────────┘
┌───────────────────────────────────────────────────────────────┐
│ Rafe's TP Collection is SHAREWARE │
├───────────────────────────────────────────────────────────────┤
│ │
│ If you find any part of Rafe's TP Collection usefull then │
│ please become a registered user by sending 10 Pounds Sterling │
│ to the address below. In return you will recieve the LATEST │
│ FULL source code to ALL the units as well anything new. │
│ │
│ Please feel free to write with suggestions, ideas or money to │
│ Rafe Aldridge, │
│ Street Farm, │
│ Dereham Road, │
│ Garvestone, │
│ Norfolk. │
│ NR9 4QT │
│ ENGLAND │
│ │
└───────────────────────────────────────────────────────────────┘
}
{$R-,S-,D-,L-}
uses vga,crt;
type
star = record
sx,sy : word; { posistion on real screen }
dx,speed : real; { posistion in "space" and speed }
end;
const
noof_stars = 50;
procedure main;
var
stars : array [1..noof_stars] of star;
z : word;
begin
for z:=1 to noof_stars do { randomize stars }
with stars[z] do
begin
sx:=random (319); { start anywhere }
sy:=random (199); { start at random height }
dx:=sx;
speed:=(random(99)+10)/99; { randomize speed }
end;
openvga;
repeat
for z:=1 to noof_stars do
with stars[z] do
begin
dx:=dx-speed; { move star }
if round(dx)<sx then { does it need replotting ? }
begin
putpixel (sx,sy,0); { delete old star }
sx:=round(dx); { move star }
if sx<1 then { has star moved off screen }
begin
sx:=319; { start at far left }
dx:=319;
sy:=random (199); { and at a random height }
end; { sx<1 }
putpixel (sx,sy,15); { redraw star }
end; { round(dx)<sx }
end; { with + for }
until keypressed;
closevga;
end;
begin
if isvga then
main
else
writeln ('This program requires vga');
end.